package pATT.bNEdit.gui;

import java.net.URL;

import javax.swing.Icon;
import javax.swing.ImageIcon;

/**
 * <p>Title: BNEdit</p>
 * <p>Description: Bayesian Network Editor</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: </p>
 * @author Martin Blech
 * @version 1.0
 */

public class ResourceManager {
  private ResourceManager() {
  }

  public static Icon getIcon(String imageName) {
	  
//		 URL url =  getClass().getResource("/pATT/bNEdit/icons/" + imageName);  
    URL url = ResourceManager.class.getClassLoader().getResource("/pATT/bNEdit/icons/" + imageName);
    url = ResourceManager.class.getClass().getResource("/pATT/bNEdit/icons/" + imageName);
     
     if (url != null) {
      return new ImageIcon(url);
    }
    else {
    	return new ImageIcon("pATT/bNEdit/icons/" + imageName);
    }
  }


}
